<%@page import="fr.uniscol.model.BaseAnneeScolaire"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<link charset="utf8" rel="stylesheet" href="<c:url value="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css" />">

<script charset="utf8" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>

<script type="text/javascript">
    $("#tableEleves").DataTable();
</script>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-10">
			<h4>Elèves</h4>
			<table id="tableEleves" class="table table-striped table-hover">
				<thead>
					<tr>
						<th>ID</th>
						<th>Nom</th>
						<th>Prénom</th>
						<th>INE</th>
						<th>Classe</th>
						<th>ID Siecle</th>
						<th>
						</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${eleves}" var="eleve">
					<tr>
						<td>${eleve.id}</td>
						<td>${eleve.nom}</td>
						<td>${eleve.prenom}</td>
						<td>${eleve.ine}</td>
						<td>
							<a href="<c:url value="classe.edit?classeid=${eleve.scolariteActuelle.classe.id}" />">${eleve.scolariteActuelle.classe.libelle}</a>
						</td>
						<td>${eleve.idSiecle}</td>
						<td>
							<button type="button" class="btn btn-primary btn-xs" onClick="javascript:location='<c:url value="eleve.edit?eleveId=${eleve.id}" />'">Modifier</button>
							<button type="button" class="btn btn-default btn-xs" onClick="javascript:location='<c:url value="eleve.delete?eleveId=${eleve.id}" />'">Supprimer</button>
						</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
</div>